package bancosys.tec.persist.controller;

import org.hibernate.SessionFactory;

import bancosys.tec.component.Controller;
import bancosys.tec.persist.dao.BaseDAOFactory;
import bancosys.tec.persist.persister.PersisterFactory;
import bancosys.tec.security.SecurityService;

/**
 * Base controller.
 * 
 * @created Jan 23, 2007
 * @author Gustavo Almeida
 */
public interface PersistenceEnabledController extends Controller {
    /**
     * Devolve o serviço de segurança.
     * 
     * @return o serviço de segurança.
     */
    SecurityService getSecurityService();

    /**
     * Devolve a fábrica de DAOs.
     * 
     * @return a fábrica de DAOs.
     */
    BaseDAOFactory getDAOFactory();

    /**
     * Devolve a session factory do hibernate.
     * 
     * @return a session factory do hibernate.
     */
    SessionFactory getSessionFactory();

    /**
     * Devolve a persister factory do hibernate.
     * 
     * @return a persister factory do hibernate.
     */
    PersisterFactory getPersisterFactory();

    /**
     * Define o serviço de segurança.
     * 
     * @param securityService o serviço de segurança.
     */
    void setSecurityService(SecurityService securityService);

    /**
     * Define a session factory do hibernate.
     * 
     * @param sessionFactory session factory do hibernate.
     */
    void setSessionFactory(SessionFactory sessionFactory);

    /**
     * Define o persisterFactory.
     * 
     * @param persisterFactory O persisterFactory a ser definido.
     */
    void setPersisterFactory(PersisterFactory persisterFactory);

}
